package soot.we.android.callGraph;

import java.util.List;

import soot.toolkits.graph.UnitGraph;
import soot.we.android.base.ComponentClass;
import soot.we.android.base.Method;

public class BuildCallGraph {
	private List<ComponentClass> classCfgList;
	ProcessCfg processCfg = new ProcessCfg();

	public BuildCallGraph(List<ComponentClass> classCfgList) {
		this.classCfgList = classCfgList;
		
	}

	public void getBuildCallGraph() {
		for(ComponentClass eCLass:classCfgList){
			//the class is entrypoint
			if(eCLass.getIsEntryPoint()){
				//Traverse the CFG of method
				for(Method eMethod:eCLass.getMethodList()){
					//start form lifecycle method ----onCreate
//					if(eMethod.getMethodName().equals("onCreate")){
						UnitGraph uGraph = eMethod.getCfgUnit();
						processCfg.TracverseCfg(uGraph);
//					}
				}
			}
		}
	}
}
